﻿using Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AnesSystem.ViewModels
{
    public class TableHeaderCtrlViewModel : BaseViewModel<TableHeaderCtrlViewModel>
    {
        #region Variables

        private Visibility _visibility = Visibility.Collapsed;

        #endregion

        #region Constructor

        public TableHeaderCtrlViewModel()
        {
            
        }

        #endregion

        #region Properties

        public Visibility Visibility
        {
            get
            {
                return _visibility;
            }

            set
            {
                _visibility = value;
                RaisePropertyChanged("Visibility");
            }
        }

        /// <summary>
        /// 设置默认显示模式 1：普通表单打印模式  2：都不显示 3:全部显示模式
        /// </summary>
        public int DefaultDisplayModel
        {
            set
            {
                if (1 == value)
                {
                    if (DataManager.Instance.CurrentPatientLink == null)
                    {
                        FunctionListHeaderCtrlViewModel.Instance.AllDisplay(false);
                    }
                    else
                    {
                        if (!DataManager.Instance.CurrentHospital.HospitalCode.Equals(HospitalConfig.HOSPITAL_CODE_CQ_NTZYY))
                        {
                            FunctionListHeaderCtrlViewModel.Instance.DisplayButton(true, FunctionListButton.打印, FunctionListButton.刷新);
                        }
                        else
                        {
                            FunctionListHeaderCtrlViewModel.Instance.DisplayButton(true, FunctionListButton.打印, FunctionListButton.刷新, FunctionListButton.保存);
                        }
                    }

                    this.Visibility = Visibility.Visible;
                    DataManager.Instance.TableHeaderCtrl._anesProcessCtrl.ViewModel.Visibility = Visibility.Collapsed;
                }
                else if (2 == value)
                {
                    this.Visibility = Visibility.Collapsed;
                    FunctionListHeaderCtrlViewModel.Instance.Visibility = Visibility.Collapsed;
                    DataManager.Instance.TableHeaderCtrl._anesProcessCtrl.ViewModel.Visibility = Visibility.Collapsed;
                }
                else
                {
                    this.Visibility = Visibility.Visible;
                    //                   FunctionListHeaderCtrlViewModel.Instance.AllDisplay(true);
                    DataManager.Instance.TableHeaderCtrl._anesProcessCtrl.ViewModel.Visibility = Visibility.Visible;
                }
            }
        }

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }

}
